<template>
  <router-view v-if="isRouterAlive" />
</template>

<script setup>
import { ref, nextTick, provide } from 'vue';

// 定义响应式状态
const isRouterAlive = ref(true);

// 定义 reload 方法
const reload = () => {
  isRouterAlive.value = false;
  nextTick(() => {
    isRouterAlive.value = true;
  });
};

// 提供 reload 方法给子组件
provide('reload', reload);
</script>

<style scoped>
</style>
